﻿@{
    ViewBag.Title = "MyFileShow";
    Layout = "~/Views/Shared/YunMp.cshtml";
}
@section Head{
    <script src="~/Application/layer/layer.min.js"></script>
    <script src="~/Scripts/areaSelect.js"></script>
    <script src="~/Scripts/jQuery.asyncLoading.js"></script>

    <script type="text/javascript">
        $(function () {
            var FileTypeShow = $.getQueryStringByName("FileTypeShow");
            var ShowCookieType = getCookie("ShowType");
            if (ShowCookieType == null) {
                setCookie("ShowType", "List", "d1");
            }
            //获取文本搜索框的值
            var SearchCookie = getCookie("SearchInfo");
            $("#SearchId").val(SearchCookie);
            var Listnum = 1;
            var gridnum = 1;

            var totalheight = 0;
            var mainList = $("#FileShowList");//主体元素
            var mainG = $("#FileShow");
            $(".module-list-view").scroll(function () {
                var h = $(this).height();//div可视区域的高度
                var sh = $(this)[0].scrollHeight;//滚动的高度，$(this)指代jQuery对象，而$(this)[0]指代的是dom节点
                var st = $(this)[0].scrollTop;//滚动条的高度，即滚动条的当前位置到div顶部的距离
                var ShowType = getCookie("ShowType");
                if ((h + st) >= sh && maxListnum >= Listnum && ShowType == "List") {
                    Listnum++;
                    DFBG.FlieOA.Flie.MyListFileShowLoad(FileTypeShow, SearchCookie, 15, Listnum);
                }
            });

            $(".module-grid-view").scroll(function () {
                var h = $(this).height();//div可视区域的高度
                var sh = $(this)[0].scrollHeight;//滚动的高度，$(this)指代jQuery对象，而$(this)[0]指代的是dom节点
                var st = $(this)[0].scrollTop;//滚动条的高度，即滚动条的当前位置到div顶部的距离
                var ShowType = getCookie("ShowType");
                if ((h + st) >= sh && maxGridnum >= Listnum && ShowType == "grid") {
                    gridnum++;
                    DFBG.FlieOA.Flie.MyGridFileShowLoad(FileTypeShow, SearchCookie, 49, gridnum);
                }
            });
            //判断大图标或列表显示方式
            if (ShowCookieType == "List") {
                $(".list-grid-switch").removeClass("grid-switched-on");
                $(".list-grid-switch").addClass("list-switched-on");
                $("#TypeShow").val("List");
                $(".FileShowList").css({ "display": "block", "height": "100%" });
                $("#FileShow").css({ "display": "none", "height": "auto" });
                $("#FileShow").parent().css({ "height": "auto" });
                $("#FileShowList").parent().css({ "height": "100%" });
                //调用方法加载网盘数据
                DFBG.FlieOA.Flie.MyGridFileShowLoad(FileTypeShow, SearchCookie, 49, Listnum);
                DFBG.FlieOA.Flie.MyListFileShowLoad(FileTypeShow, SearchCookie, 15, gridnum);
            }
            else {
                $(".list-grid-switch").removeClass("list-switched-on");
                $(".list-grid-switch").addClass("grid-switched-on");
                $("#TypeShow").val("Tu");
                $(".FileShowList").css({ "display": "none", "height": "100%" });
                $("#FileShowList").parent().css({ "height": "auto" });

                $("#FileShow").css({ "display": "block", "height": "auto" });
                $("#FileShow").parent().css({ "height": "100%" });
                //调用方法加载网盘数据
                DFBG.FlieOA.Flie.MyListFileShowLoad(FileTypeShow, SearchCookie, 15, gridnum);
                DFBG.FlieOA.Flie.MyGridFileShowLoad(FileTypeShow, SearchCookie, 49, Listnum);
            }
            //清空cookie
            setCookie("SearchInfo", $("#SearchId").val(), "d-1");

        })
    </script>
}
<body>
    <div class="oh module-toolbar">
        <input type="hidden" id="HidFileId" />@*存放父级文件id*@
        <div class="list-grid-switch grid-switched-on">
            <input type="hidden" id="TypeShow" value="Tu" />@*存放显示类型（图标显示/列表显示）*@
            <a onclick="SelShowType('List')" href="#" class="list-switch"></a>
            <a onclick="SelShowType('grid')" href="#" class="grid-switch"></a>
        </div>
        <div class="bar ">
            <div style="position: absolute; top: 0px; padding-top: 11px; line-height: normal;">
                <a class="g-button g-button-blue upload-wrapper">
                    <span onclick='DFBG.FlieOA.Flie.showLayer();' class="g-button-right"><em title="上传" class="icon icon-upload"></em><span class="text" style="width: 20px;">上传</span></span>
                </a>
                <a href="#" onclick="DFBGFlie.Flie.FlieOperation.ShareTransfer()" class="g-button FlieOperation" style="margin:0px;"><span class="g-button-right" style="background-position: -20px -144px;"><em title="分享" class="icon icon-share-gray"></em><span class="text" style="width: auto;">分享</span></span></a><a href="#" onclick="    DFBGFlie.Flie.FlieOperation.DownFileMore()" class="g-button FlieOperation" style="margin: 0px; border-left: 1px solid #bbcbdf; background-position: -10px -144px; "><span class="g-button-right" style="background-position:-20px -144px;"><em title="下载" class="icon icon-download-gray"></em><span class="text" style="width: auto;">下载</span></span></a><a href="#" onclick="    DFBGFlie.Flie.FlieOperation.Transfer('', 'parent','Yes')" class="g-button FlieOperation" style=" margin: 0px; background-position: -10px -144px; border-left:1px solid #bbcbdf; "><span class="g-button-right" style="background-position:-20px -144px;"><em title="删除" class="icon icon-delete"></em><span class="text" style="width: auto;">删除</span></span></a><a href="#" onclick="    DFBGFlie.Flie.FlieOperation.OnReNameFor()" class="g-button FlieOperation Renamed" style="margin: 0px; background-position: -10px -144px; border-left:1px solid #bbcbdf; "><span class="g-button-right" style="background-position:-20px -144px;"><span class="text" style="width: auto;">重命名</span></span></a><a href="#" onclick="    DFBGFlie.Flie.FlieOperation.MoveShow(1)" class="g-button FlieOperation" style="margin: 0px; background-position: -10px -144px; border-left:1px solid #bbcbdf; "><span class="g-button-right" style="background-position:-20px -144px;"><span class="text" style="width: auto;">复制到</span></span></a><a href="#" onclick="    DFBGFlie.Flie.FlieOperation.MoveShow(2)" class="g-button FlieOperation" style="margin: 0px; background-position: -10px -144px; border-left:1px solid #bbcbdf; "><span class="g-button-right"><span class="text" style="width: auto;">移动到</span></span></a>
            </div>
            <a href="javascript:void(0);" onclick="SearchFileMethod()" class="g-button" style="display: inline-block; margin-left: 0px; float: right;">
                <span class="g-button-right">
                    搜索
                </span>
            </a><span class="g-button" style="display: inline-block; float:right;  padding-left:0px; margin-right:0px;">
                <span class="g-button-right" style="padding-right:1px;">
                    <input id="SearchId" type="text" style="border:0px; height:21px;width :200px; padding:2px 5px; margin-top:1px;" />
                </span>
            </span>
        </div>
    </div>
    <div style="padding-left: 10px;">
        <div style="height: 30px; line-height: 30px; padding-left: 10px; position: relative;">
            @*<span>全部文件</span>*@
            <span style="float: left; margin-right: 20px;" id="SumListNum"></span>
            <span style="float: left; margin-right: 20px;" id="SumGridNum"></span>

        </div>
        <div class="list-view-header FileShowList" style="display:none;">
            <div class="list-header">
                <ul class="list-cols" style="display: block;">
                    <li style="width: 59%;" class="col first-col descend">
                        <div class="col-item check"><input type="checkbox" class="check-icon" onclick="AllCheck()" id="checkAll" /></div>
                        <span class="text">文件名</span><span class="order-icon"></span>
                    </li>
                    <li style="width: 16%;" class="col"><span class="text">大小</span><span class="order-icon"></span></li>
                    <li style="width: 23%;" class="col last-col"><span class="text">上传日期</span><span class="order-icon"></span></li>
                </ul>

            </div>
        </div>
        <div style="display: block;" class="list-view-container">
            <div class="module-list-view" style="height: auto; overflow-x: hidden; overflow-y: auto;">
                @*  列表显示*@
                <div id="FileShowList" class="list-view FileShowList" style="margin-top: 0px; display: none; height: 100%;">
                </div>
            </div>
            @*大图标显示*@
            <div class="module-grid-view" style="height: auto; overflow-x: hidden; overflow-y: auto;">
                <ul id="FileShow" class="grid-view" style="margin-top: 0px; display: block; height: 100%;"></ul>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(function () {
            $('.module-grid-view').areaSelect();
        })
    </script>
</body>

